﻿<%@ Page Language="vb" AutoEventWireup="false" MasterPageFile="~/Master_Page/Master_Popup.Master"
    CodeBehind="TugBeforeAndAfter.aspx.vb" Inherits="I_PORT.TugBeforeAndAfter" title="IRPC INTELLIGENT PORT SERVICE" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register Src="~/Control/Confirm.ascx" TagName="Confirm1" TagPrefix="Confirm" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <script type="text/javascript" language="javascript">
                        var _source;
    // keep track of the popup div
    var _popup;

    function showConfirm(customerid) {
        this._source = customerid;
        this._popup = $find('ModalPopupExtender3'); 
        this._popup.show();  
    }
       function okClick(){
        //  find the confirm ModalPopup and hide it
       this._popup.hide();

        __doPostBack(this._source.name,'');
        
    }
        function cancelClick(){
        //  find the confirm ModalPopup and hide it
        this._popup.hide();
    }
    </script>
    <asp:UpdatePanel ID="UpdatePanelDelayPopup" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <table width="100%" border="0" cellpadding="2" cellspacing="0">
                <tr>
                    <td colspan="2" align="center">
                        <fieldset style="width: 95%"><legend><asp:Label ID="lbLegend" runat="server" SkinID="lbtxt" Text="xxx"></asp:Label></legend>
                            <table width="95%" border="0" cellpadding="2" cellspacing="0">
                                <tr>
                                   <td style="height:5px;"><img src="../Image/space.gif" /></td>
                                </tr>
                                <tr>
                                   <td colspan="2">
                                   <asp:GridView ID="gridTug" runat="server" SkinID="gridblueNoPage" DataKeyNames=""
                                                                                            AutoGenerateColumns="False">
                                                                                            <Columns>
                                                                                                <asp:BoundField HeaderText="Tug" DataField="TugName" />
                                                                                                <asp:TemplateField HeaderText="ลบ" ItemStyle-Width="50px" ItemStyle-HorizontalAlign="Center">
                                                                                                    <ItemTemplate>
                                                                                                        <asp:ImageButton ID="imgdelete" CommandName="cmddelete" CommandArgument="<%# Container.DataItemIndex %>"
                                                                                                            OnClientClick="showConfirm(this); return false;" runat="server" ImageUrl="~/Image/cancel-24.gif" />
                                                                                                    </ItemTemplate>
                                                                                                </asp:TemplateField>
                                                                                            </Columns>
                                                                                        </asp:GridView>
                                   </td>
                                </tr>
                                <tr>
                                    <td style="width: 20%;" align="right">
                                        <asp:Label ID="Label1" runat="server" Text="Tug Name :" SkinID="lbtxt"></asp:Label>&nbsp;
                                    </td>
                                    <td align="left">
                                        <asp:TextBox ID="txtTug" runat="server" Width="300px"></asp:TextBox>&nbsp;<asp:Button
                                            ID="btnTug" runat="server" CssClass="ButtonStyle" Text="Add Tug" />
                                    </td>
                                </tr>
                                <tr>
                                   <td style="height:5px;"><img src="../Image/space.gif" /></td>
                                </tr>
                            </table>
                        </fieldset>
                    </td>
                </tr>
                <tr>
                    <td colspan="2" align="center">
                        <asp:Button ID="btnSave" runat="server" CssClass="ButtonStyle" Text="บันทึก" />
                        <asp:Button ID="btnClear" runat="server" CssClass="ButtonStyle" Text="ปิด" />
                    </td>
                </tr>
            </table>
            <asp:Button ID="BtnTrigger" runat="server" Style="display:none" />
            <asp:ModalPopupExtender ID="ModalPopupExtender3" BehaviorID="ModalPopupExtender3" runat="server" 
                                    OkControlID="ctl00_contentplaceholder1_ConfirmDelete_btnOk" 
                                    OnOkScript="okClick();" 
                                    CancelControlID="ctl00_contentplaceholder1_ConfirmDelete_btnNo"     
                                    OnCancelScript="cancelClick();" 
                                     BackgroundCssClass="Background" DropShadow="false" 
                                      PopupControlID="PanelConfirm" TargetControlID="BtnTrigger" >
        </asp:ModalPopupExtender>
         <asp:Panel ID="PanelConfirm" runat="server" style="display:none;">
       <Confirm:Confirm1 ID="ConfirmDelete" runat="server" ></Confirm:Confirm1>
    </asp:Panel>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
